package net.jxtz.jxtzos.entity.spider;


import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import net.jxtz.jxtzos.spider.converter.ExcelPropForTime;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(exclude = {"jid", "createTime"})
public class SpiderJingdong implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ExcelIgnore
    @TableId(type = IdType.ASSIGN_ID)
    private Long jid; // 主键

    @ExcelIgnore
    private Integer issue;

    @ExcelIgnore
    private Integer id; // 商品id

    @ExcelProperty("省")
    private String province;

    @ExcelProperty("市")
    private String city;

    @ExcelProperty("区/县")
    private String county;

    @ExcelProperty("地址")
    private String address;

    @ExcelProperty("拍卖房屋类型")
    @TableField("paimaiChildren")
    private String paimaiChildren;

    @ExcelProperty("标题")
    private String title; // 标题

    @ExcelProperty("成交确认书")
    @TableField("confirmationUrl")
    private String confirmationUrl; // 成交确认书

    @ExcelProperty("当前价")
    @TableField("currentPrice")
    private BigDecimal currentPrice; // 当前价｜成交价

    @ExcelProperty("评估价")
    @TableField("assessmentPrice")
    private BigDecimal assessmentPrice; // 评估价

    @ExcelProperty("起拍价")
    @TableField("startPrice")
    private BigDecimal startPrice; // 起拍价

    @ExcelProperty("加价幅度")
    @TableField("priceLowerOffset")
    private BigDecimal priceLowerOffset; // 加价幅度

    @ExcelProperty("拍卖次数")
    @TableField("paimaiTimes")
    private Integer paimaiTimes; // 拍卖次数

    @ExcelIgnore
    @TableField("albumId")
    private Integer albumId; // 公告id
//
//    private String gongGao; // 公告代码
//
//    private String confirmationUrl; // 成交确认书

    @ExcelProperty(value = "成交时间", converter = ExcelPropForTime.class)
    @TableField("endTime")
    private Long endTime; // 成交时间

    @ExcelProperty("房屋用途")
    @TableField("housingUse")
    private String housingUse; // 房屋用途

    @ExcelProperty("建筑面积")
    @TableField("housingArea")
    private String housingArea; // 建筑面积

    @ExcelProperty("建筑结构")
    @TableField("housingBuildStructure")
    private String housingBuildStructure; // 建筑结构

    @ExcelProperty("装修")
    private String decoration; // 装修


    @ExcelProperty("链接")
    private String url;

    @ExcelIgnore
    @TableField("spiderLogId")
    private Long spiderLogId;


    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT, value = "createTime")
    private Integer createTime; // 创建时间

}
